package com.zxy.fmmall.controller;

import com.zxy.fmmall.service.UserAddrService;
import com.zxy.fmmall.vo.ResultVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin
@RequestMapping("/userAddr")
@Api(value = "提供收货地址相关接口", tags = "收获地址管理")
public class UserAddrController {
    @Autowired
    private UserAddrService userAddrService;

    @GetMapping("/list/{userId}")
    @ApiOperation("显示用户地址")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId",value = "用户的id",required = true)
    })
    public ResultVo listAddrsByUserId(@PathVariable("userId") String userId){
       return userAddrService.listAddrsByUserId(userId);
    }
}
